<?php 
ob_start();
require('fun.php');
require('lang.php');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>主页 - <?php echo WEBSITE_NAME; ?></title>
<script language="javascript">
var defaultUsername = '<?php echo TheID; ?>';
</script>
<script language="javascript" src="lajax.js"></script>
<script language="javascript" src="1.js"></script>
<link href="1.css" rel="stylesheet" type="text/css" charset="UTF-8">
</head>
<body>
<table class="top">
  <tr> 
    <td class="left"><a href="index.php"><?php echo WEBSITE_NAME; ?></a> | <a href="m_p.php"><?php echo WEBSITE_NAME; ?>手机版</a> | <a href="?replies">回复</a> | <a href="?default">秘密列表</a>
	<td class="right" width="200" align="right"><a href="https://twitter.com/<?php echo TheID; ?>">@<?php echo TheID; ?></a></td>
  </tr>
</table>
<div class="topspace"></div>
<div id="userarea">
<p>欢迎访问<?php echo WEBSITE_NAME; ?>，你可以在这里匿名秀一下你的秘密/糗事/新鲜事/小愿望。</p>
<p>本站点的维护者为@<a href="https://twitter.com/<?php print(MASTER_ID); ?>"><?php print(MASTER_ID); ?></a>。记得使用之前看看<a href="usage.php">注意事项</a>哦。</p><p>禁止发布<span style="color:red;"><strike>外站链接</strike></span>，不得@除<?php print(MASTER_ID); ?>外的其他用户（如：<span style="color:red;"><strike>@rtmeme </strike>×</span> <span style="color:green;">@<?php echo TheID; ?> √</span>），禁止使用<span style="color:red;"><strike>标签符号"#"</strike></span>，禁止使用@<?php echo TheID; ?> <span style="color:red;"><strike>follow/dm/fav</strike></span> 其他用户。</p>
<form onSubmit="checkR()" action="./" method="post" name="post_block" id="post_block">
  <table border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td rowspan="2"><textarea onKeyUp="counter()" onChange="counter()" name="m" rows="4" id="m"></textarea></td>
      <td width="120">能写<span id="charcount">140</span>字</td>
    </tr>
    <tr>
      <td valign="bottom"><input type="hidden" name="r" id="r" value="">
	  <input onClick="checkR()" id="submit" type="submit" value="发布">
      <a href="usage.php">注意事项</a>
	  </td>
    </tr><?php if (isset($_POST['m'])) { ?>
	<tr>
	  <td colspan="2" align="center"><?php echo (post($_POST['m'])!=NULL)?"成功发布":"..发布失败"; ?></td>
	</tr><?php } ?>
  </table>
</form>
<p>现在大概已经有<?php echo $_SESSION["me"]->statuses_count; ?>条信息在树洞里了。</p>
<table id="tweets">
<tbody>
<?php 
$data = $connection->get('statuses/'.(isset($_GET['replies'])?'mentions':'user_timeline'), array());
$dddd='0';
foreach ($data as $entry) { 
	$dddd = $entry->id;
	if ($entry->user->screen_name==TheID) $entry->user->screen_name = '';
	include('bin/tweet.php');
} ?>
<tr id="moredata"><td onClick="loadmore('<?php echo $dddd; ?>');">点击载入更多内容</td></tr>
</tbody>
</table>
<?php if (isset($_GET['replies'])) { ?>
<script language="javascript">
moremode='replies';
</script>
<?php } ?>
</div>
<?php require('bin/bottom.php'); ?>
</html>